package framework.utils;

/**
 * 线程工具
 */
public class ThreadUtil {

    /**
     * 启动一个后台线程
     *
     * @param runnable
     * @return
     */
    public static Thread startDaemonThread(Runnable runnable) {
        Thread thread = new Thread(runnable);
        thread.setDaemon(true);
        thread.start();
        return thread;
    }

    /**
     * 启动一个后台线程
     *
     * @param runnable
     * @return
     */
    public static Thread startThread(Runnable runnable) {
        Thread thread = new Thread(runnable);
        thread.start();
        return thread;
    }

}
